import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { router } from '@/router'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// 注册业务组件（示例）
import { componentRegistry } from '@/core/ComponentRegistry'
import UserCard from '@/components/business/UserCard.vue'

componentRegistry.register('UserCard', UserCard, {
  name: 'UserCard',
  label: '用户卡片',
  icon: '👤',
  props: {
    avatar: 'https://via.placeholder.com/60',
    name: '张三',
    role: '前端工程师'
  },
  events: {
    click: [{ type: 'alert', params: { message: '查看 {{name}} 的详情' } }]
  }
})

const app = createApp(App)
const pinia = createPinia()

app.use(pinia)
app.use(router)
app.use(ElementPlus)
app.mount('#app')
